package com.appwoo.txtws.component;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import java.util.ArrayList;
import java.util.List;

public class LimitationHandler
{
  public static final String KEY_ADS = "ads";
  public static final String KEY_DOWNLOAD = "download";
  public static final String KEY_FUN = "fun";
  public static final String KEY_GAMBLE = "gamble";
  public static final String KEY_GOVERN = "govern";
  public static final String KEY_ILLEGAL = "illegal";
  public static final String KEY_INDUSTRY = "industry";
  public static final String KEY_OTHERS = "others";
  public static final String KEY_PERSON = "person";
  public static final String KEY_PORN = "porn";
  public static final String KEY_UNKOWN = "unkown";
  public static final String KEY_VIRUS = "virus";
  public static final String SP_WEBSITE = "website";
  private List<String> keywords;

  public LimitationHandler()
  {
  }

  public LimitationHandler(int paramInt)
  {
    this.keywords = new ArrayList(paramInt);
    this.keywords.add("virus");
    this.keywords.add("porn");
    this.keywords.add("gamble");
    this.keywords.add("illegal");
    this.keywords.add("download");
    this.keywords.add("person");
    this.keywords.add("others");
    this.keywords.add("fun");
    this.keywords.add("ads");
    this.keywords.add("govern");
    this.keywords.add("industry");
    this.keywords.add("unkown");
  }

  public boolean isLimit(Context paramContext, String paramString)
  {
    int i;
    if ((!"virus".equals(paramString)) && (!"porn".equals(paramString)) && (!"gamble".equals(paramString)))
    {
      boolean bool = "illegal".equals(paramString);
      i = 0;
      if (!bool);
    }
    else
    {
      i = 1;
    }
    if (i != 0)
      return paramContext.getSharedPreferences("website", 0).getBoolean(paramString, true);
    return paramContext.getSharedPreferences("website", 0).getBoolean(paramString, false);
  }

  public List<Boolean> restore(Context paramContext, int paramInt)
  {
    SharedPreferences localSharedPreferences = paramContext.getSharedPreferences("website", 0);
    ArrayList localArrayList = new ArrayList();
    if (!localSharedPreferences.contains("ads"))
    {
      int k = 0;
      if (k >= paramInt)
        return localArrayList;
      int m;
      label54: int n;
      if (k != 0)
      {
        if (k == 1)
        {
          m = 1;
          if (k != 2)
            break label101;
          n = 1;
          label63: if (((n | m) == 0) && (k != 3))
            break label107;
        }
      }
      else
        localArrayList.add(Boolean.valueOf(true));
      while (true)
      {
        k++;
        break;
        m = 0;
        break label54;
        label101: n = 0;
        break label63;
        label107: localArrayList.add(Boolean.valueOf(false));
      }
    }
    int i = this.keywords.size();
    int j = 0;
    label136: if (j < i)
    {
      if (!localSharedPreferences.getBoolean((String)this.keywords.get(j), false))
        break label185;
      localArrayList.add(Boolean.valueOf(true));
    }
    while (true)
    {
      j++;
      break label136;
      break;
      label185: localArrayList.add(Boolean.valueOf(false));
    }
  }

  public void save(Context paramContext, List<Boolean> paramList)
  {
    int i = paramList.size();
    SharedPreferences.Editor localEditor = paramContext.getSharedPreferences("website", 0).edit();
    for (int j = 0; ; j++)
    {
      if (j >= i)
        return;
      if (((Boolean)paramList.get(j)).booleanValue())
        localEditor.putBoolean((String)this.keywords.get(j), true);
    }
  }
}

/* Location:           C:\Documents and Settings\Administrator\classes_dex2jar.jar
 * Qualified Name:     com.appwoo.txtws.component.LimitationHandler
 * JD-Core Version:    0.6.2
 */